import { Camera, find, screen, Vec3 } from "cc";
import { guideCenter } from "../guideCenter";
import { GuideCmd, GuideExeSequence, GuideForceType, IGuideConfig, IGuideForceClickArgs, IGuideTips } from "../iGuide";

export class guide2 {
    static clickCnt: number = 0;
}

const guide_2 = <IGuideConfig>{
    id: 2,
    name: "点击按钮3 3次",
    isRunGuide: true,
    isLocalSave: false,
    exeSequence: GuideExeSequence.Queue,
    steps: [
        {
            desc: "点击按钮3",
            command: {
                cmd: GuideCmd.ForceGuide,
                args: <IGuideForceClickArgs>{
                    type: GuideForceType.Click,
                    locators: () => ["UI/Btn3"],
                    stepCondition: () => {
                        return guide2.clickCnt >= 3;
                    },
                    tips: <IGuideTips>{
                        getTips: () => {
                            return `点击按钮3 ${3 - guide2.clickCnt}次`;
                        },
                        getWorldPos: nodePos => new Vec3(nodePos.x, nodePos.y + 200, 0)
                    },
                },
            },
            isSaveServer: true
        }
    ],
}

guideCenter.registerGuide(guide_2);
